<?php
/**
 * Created by PhpStorm.
 * User: sunzexin
 * Date: 2017/12/29
 * Time: 18:23
 */

namespace App\Http\Traits;


use Illuminate\Http\Request;

trait ProductTrait
{
    use BaseTrait;
    // 货品名称
    protected $name;
    // 分类ID
    protected $category_id;
    // 运费
    protected $carriage;
    // 图片字符串
    protected $photo_list_str;
    // 验证秘钥
    protected $loginSession;
    // 规格字符串
    protected $standard_list_str;
    // 货品详情字符串
    protected $content_str;
    // 货品ID
    protected $product_id;
    // 标签列表字符串
    protected $tag_list_str;
    // 分页大小
    protected $limit;
    // 标签ID
    protected $tag_id;
    // 咖啡馆ID
    protected $cafe_id;
    // 合作者ID
    protected $partner_id;
    // 关键字
    protected $keyword;

    public function __construct(Request $request)
    {
        $this->name = $request->input('name', '');
        $this->carriage = $request->input('carriage', 0);
        $this->photo_list_str = $request->input('photo_list_str', '');
        $this->loginSession = $request->input('loginSession', '');
        $this->category_id = $request->input('category_id', 0);
        $this->standard_list_str = $request->input('standard_list_str', '');
        $this->content_str = $request->input('content_str', '');
        $this->product_id = $request->input('product_id', 0);
        $this->tag_list_str = $request->input('tag_list_str', '');
        $this->limit = $request->input('limit', 0);
        $this->tag_id = $request->input('tag_id', 0);
        $this->cafe_id = $request->input('cafe_id', 0);
        $this->partner_id = $request->input('partner_id', 0);
        $this->keyword = $request->input('keyword', '');
    }
}